package wlf.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import wlf.pojo.ShowInfo;
import wlf.service.ShowInfoService;

@Controller
public class ShowInfoController {
	@Resource
	private ShowInfoService showInfoServiceImpl;
	
	@RequestMapping("/toManager")
	public ModelAndView toManager(HttpServletRequest request,int id){
		ModelAndView m = new ModelAndView("/WEB-INF/backstage/manager.jsp");
		ShowInfo show = showInfoServiceImpl.selById(id);
		request.setAttribute("show",show);
		request.setAttribute("id",id);
		return m;
	}
	@RequestMapping("/toPage")
	public ModelAndView toPage(HttpServletRequest request,int id,int flag){
		ModelAndView m = new ModelAndView("/WEB-INF/backstage/page.jsp");
		ShowInfo show = showInfoServiceImpl.selById(id);
		request.setAttribute("show",show);
		request.setAttribute("flag",flag);
		request.setAttribute("id",id);
		return m;
	}
	
}
